import { Opt } from '__com/Opt.js'
import ruleOpt from '@/option/rule.js'
import cityOpt from '@/option/city.js'
// import apiMgr from '../../biz/index'
export class editOpt extends Opt {
  constructor(fun) {
    super(fun)
  }
  create() {
    return [
      [
        {
          title: '项目名称',
          key: 'tenantName',
          text: {}
        },
        {
          title: '合同主体',
          key: 'companyName',
          text: {},
          value: (info) => {
            return `${info.companyName}(${info.tenantCode})`
          }
        }
      ],
      [
        {
          title: '所属人名称',
          key: 'belongUserName',
          text: {}
        },
        {
          title: '所属人手机号',
          key: 'belongUserPhone',
          text: {}
        }
      ],
      {
        title: '所属城市',
        key: 'city',
        text: {}
      }
    ]
  }
}
export class packageOpt extends Opt {
  constructor(fun) {
    super(fun)
  }
  create() {
    return [
      [
        {
          title: '有效期起始日期',
          key: 'effectStartDate',
          text: {}
        },
        {
          title: '有效期结束日期',
          key: 'effectEndDate',
          text: {}
        }
      ],
      [
        {
          title: '冻结起始日期',
          key: 'freezeStartDate',
          text: {}
        },
        {
          title: '冻结结束日期',
          key: 'freezeEndDate',
          text: {}
        }
      ],
      [
        {
          title: '项目冻结天数',
          key: 'freezeDay',
          text: {}
        }
      ],
      [
        {
          title: '项目有效天数',
          key: 'effectDay',
          text: {}
        },
        {
          title: '有效期剩余天数',
          key: 'effectSurplusDay',
          text: {}
        }
      ]
    ]
  }
}
export class refuelingOpt extends Opt {
  constructor(fun) {
    super(fun)
  }
  create() {
    return [
      [
        {
          title: '项目账号数',
          key: 'accountNumber',
          group: [
            {
              key: 'accountNumber',
              col: 4,
              text: {}
            },
            {
              placeholder: '个',
              col: 2,
              text: {}
            }
          ]
        },
        {
          title: '已使用账号数',
          key: '',
          group: [
            {
              key: '',
              col: 4,
              text: {},
              data: {
                from: (info) => {
                  console.log(info.accountNumber, 'mmmmmmmmm')
                  return info.accountNumber - info.accountSurplusNumber
                }
              }
            },
            {
              placeholder: '个',
              col: 2,
              text: {}
            }
          ]
        }
      ],
      [
        {
          title: '剩余账号数',
          key: 'accountSurplusNumber',
          group: [
            {
              key: 'accountSurplusNumber',
              col: 4,
              text: {}
            },
            {
              placeholder: '个',
              col: 2,
              text: {}
            }
          ]
        }
      ]
    ]
  }
}
